home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / strategy / xvmahjon.por / xvmahjon / xvmahjongg / README.too < prev   
Text File  |  1991-12-22  |  7KB  |  139 lines

  1. December 20, 1991
  2.  
  3. 1.  Introduction and Background
  4.  
  5. This package includes a Mahjongg solitaire game for both XView/X11
  6. and SunView.  The XView version was developed in the 8/91 to
  7. 9/91 time frame, using XView 2.0, with some clean-up and
  8. XView 3.0/OpenWindows 3.0 testing and compatibility work done
  9. in 12/91.
  10.      The XView version was ported from the SunView version, which
  11. was originally developed in 1988 by Mark A. Holm (and others).
  12. The XView version supports the same multi-colored icons and game
  13. playing interface as the SunView version.  Also, the XView source
  14. code re-uses a fair amount of code from the SunView version.
  15.      Minor changes were made to the SunView code distributed in
  16. this package so that both sets of code could share all the icon
  17. files, and one of the source files.  The icon files had to be
  18. patched as well, since there were extraneous bits set that had
  19. no effect under SunView but did cause problems under XView.
  20. I also implemented a compression scheme for the icon files,
  21. to significantly reduce the size of the source package for
  22. distribution purposes.
  23.  
  24. There is another X11 compatible version of Mahjongg, the xmahjongg
  25. program by Jeff S. Young, which was available as early as June 1989,
  26. and probably earlier, although I first came across it in Sept. 90.
  27. This version is also derived from Mark A. Holm's program, although
  28. perhaps only the monochrome icons were re-used.  Xmahjongg has several
  29. new features unique to it, including the ability to define different
  30. board layouts.
  31.      However, that program does not support the multi-colored icons,
  32. nor the game playing interface of SunView Mahjongg, which includes
  33. the ability to cancel a move and also to undo moves.  I felt that
  34. these were some of the best features of the original Mahjongg game,
  35. and used this as motivation to port the program to XView.  I also
  36. pursued this mainly as a learning exercise, as I am a novice-level
  37. XView programmer.  I wasn't sure how successful I'd be when I
  38. started, but now that it's finished, might as well make it public.
  39.  
  40. 2.  The XView Source Code -- Tips and Tricks
  41.  
  42. The XView source code was derived from the SunView source with
  43. an assist from the SunView to XView conversion program that Sun
  44. provides with both OpenWindows and the XView toolkit package.
  45. Although most of the code converted had to be changed in some
  46. way, it still provided a good starting point.
  47.  
  48. The trickiest part of the port was in making an XView canvas
  49. act the same way as a SunView panel.  SunView mahjongg used
  50. a panel and PANEL_BUTTON's with PANEL_LABEL_IMAGE's for the game
  51. tiles.  This was not going to work under XView because XView
  52. wraps a 3D button image around image buttons.  So I used a canvas
  53. and via event handlers and color map tricks and pixwin calls,
  54. was able to make it behave as in SunView mahjongg.  Implementing
  55. the high-lighting of tiles in XView was the toughest part.
  56.  
  57. The final source code has a fair number of lines that were
  58. essentially unchanged from the SunView version.  I purposely
  59. avoided editing or re-formatting this code in most cases.
  60. I mention this because if you look at the code you will find some
  61. strange-looking indentation and spacing sometimes.  I always try
  62. to be consistent in my coding style, but my style differs somewhat
  63. from the prior author's style.
  64.  
  65. There are two XView features I used which are undocumented,
  66. although they work fine in both XView 2.0 and 3.0
  67. (and OpenWindows 2.0 and 3.0).  Nevertheless, they may or may
  68. not be supported in future versions of XView--I have no idea
  69. at this point, but I plan to ask.  The two features were used
  70. to implement two different methods of inverting colors on the
  71. game tiles.  Both methods are supplied because one provides a
  72. fallback method for the other, and also because certain
  73. X server environments might need to use one method rather than
  74. the other.  The two methods are selectable via command-line
  75. options.
  76.     The two undocumented features are:
  77. (1) the use of the xv_destroy_status() routine, which is
  78.     similar in spirit to the documented xv_destroy() routine
  79. (2) the modifying of an internal XView data structure, as
  80.     shown by the declaration:
  81.     extern struct pixrectops mem_ops;
  82.     Access to this struct allowed me to install a routine to
  83.     enable pw_read() to work.
  84.  
  85. See the code for more details on the use of these undocumented
  86. features.
  87.  
  88. 3.  Copyrights and Disclaimers
  89.  
  90.     (Some of this is meant primarily for any fellow employees of
  91.     The Boeing Company who might be reading this.  If after reading
  92.     it you think I'm a little paranoid, well, maybe it's because
  93.     you haven't worked for a big company 8-).)
  94.  
  95. Mark A. Holm, the author of the original 1988 SunView version, has
  96. a copyright on the icons and the SunView source code.  Some of the
  97. code in the XView version comes straight from the SunView version,
  98. so that code is covered by Mark A. Holm's copyright as well.
  99. I might as well claim a copyright on the rest of the code in the
  100. XView version.  The common and new code can be determined by
  101. running a diff comparison between the old and the new code.  Since
  102. Mark A. Holm distributed the original code under the following policy:
  103.  
  104.     Permission is given to copy and distribute for non-profit purposes.
  105.  
  106. by rights the new XView version should (and will) maintain this policy.
  107. So you can't sell this program, but you can give it away freely.
  108.  
  109.  
  110. (This is not official legalese, it's just off the top of my head...)
  111. Neither I nor my employer, The Boeing Company, warrant or guarantee
  112. the fitness, functionality or suitability of this software for any
  113. purpose, nor shall we be held liable for any damages, reprimands
  114. or job losses that may result from the use of the program, or from
  115. re-use of source code or documentation contained within.
  116.  
  117. As the playing of computer games on company equipment is strictly
  118. against Boeing Company policy, I feel it necessary to state for the
  119. record that in developing and distributing this software that I
  120. neither endorse nor encourage the playing of this game, especially
  121. on Boeing Company equipment.
  122.      If I used company time (most of it was done in my spare time)
  123. or equipment during development of this program, it was with the
  124. primary goal of gaining new knowledge and experience in the
  125. building of applications employing graphical user interfaces.
  126. Because what I learned in doing this work is directly applicable
  127. to future non-game-related programs that I may build, I believe
  128. the positives to the Boeing Company, in terms of my improved skills,
  129. vastly outweigh the negatives that I may have incurred or caused
  130. by building and/or using this software.
  131.  
  132.  
  133.             Stanley Ken Tazuma
  134.             Boeing Computer Services, a division of
  135.             The Boeing Company
  136.  
  137.             skt@sundry.boeing.com
  138.             uw-beaver!bcsaic!sundry!skt
  139.